#pragma once

#include "../instrument.h"
#pragma once
#include "NetworkProtocol.h"
#include "wx/socket.h"

enum {EEG =1, IMPEDANCE, CALIB};

#define PORT_NUMBER	5000
#define BTSOCKET_ID 53526

class EEG1042 : public wxEvtHandler, public Instrument
{
public:
	EEG1042();
	~EEG1042(void);
	void	*Entry(void);
	void	StartDevice(wxString FileName,wxString FilePath,bool File);
	void	StopDevice(void);
	int		OpenPort(const char* OpenVal1, const char *OpenVal2, const char *OpenVal3);
	int		ReadMessage(SOCKET socket, char* Data);
	int		SendMessage(SOCKET socket, char* Data);
	void	OnSocketEvent(wxSocketEvent& event);
	void	SendFrame (CastFrame *Frame);
	int		ControlFrame(void);

private:
	
	//wxString hostname;
	wxString Message;
	wxSocketClient *m_sock;
	NetworkProtocol *BrainBox;
	int SetElectrodes;
	int nDevices;
	int nChannels;
	wxString Electrodes[512];	//MAX 512 CHANNELS

	DECLARE_EVENT_TABLE()
};



